package com.example.login;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class HomeActivity extends AppCompatActivity {
    private TextView mTvAccount,mTvPassword;
    private Button mBtnConfirm;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);

        initView();

        Intent intent = getIntent();
        String account = intent.getStringExtra("account");
        String password = intent.getStringExtra("password");
        mTvAccount.setText(account);
        mTvPassword.setText(password);

        mBtnConfirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent1 = new Intent();
                intent1.putExtra("confirmInfo","已接收到账号和密码");
                setResult(2,intent1);
                finish();
            }
        });
    }

    private void initView() {
        mTvAccount = findViewById(R.id.tv_account);
        mTvPassword = findViewById(R.id.tv_password);
        mBtnConfirm = findViewById(R.id.btn_confirm);
    }
}
